package com.lsege.controller.backstage;

import com.github.pagehelper.PageHelper;
import com.lsege.entity.JsonResult;
import com.lsege.entity.Page;
import com.lsege.entity.backstage.BkClientRepair;
import com.lsege.service.backstage.BkClientRepairService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * Created by Administrator on 2017/7/6.
 */
@RestController
@RequestMapping("/bkClientRepair")
public class BkClientRepairController {
    @Autowired
    BkClientRepairService bkClientRepairService;

    @GetMapping("getBkClientRepairList")
    public JsonResult getBkClientRepairList(Integer pageNum,Integer pageSize){
        JsonResult json = new JsonResult();
        PageHelper.startPage(pageNum,pageSize);
        List<BkClientRepair> list = bkClientRepairService.queryBkClientRepairList();
        Long total = bkClientRepairService.queryBkClientRepairCount();
        json.setData(new Page(list,total,pageSize,pageNum));
        json.setSuccess(true);
        json.setMessage("获取成功");
        return json;
    }
}
//org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.type.TypeException: Could not set parameters for mapping:
//        ParameterMapping{property='state', mode=IN, javaType=class java.lang.String, jdbcType=null, numericScale=null, resultMapId='null', jdbcTypeName='null', expression='null'}.
//        Cause: org.apache.ibatis.type.TypeException: Error setting non null for parameter #1 with JdbcType null . Try setting a different JdbcType for this parameter or a different configuration property.
//        Cause: java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.String
